<?php

/**
 * Description of Laboratorio
 *
 * @author markos
 */
class VirtualLabs_Academico_Usuario {

    const TABLE_NAME = 'usuario';

    public function getUsuario($username) {
        $db = Zend_Db_Table::getDefaultAdapter();
        try {
            $select = $db->select()->from(VirtualLabs_Academico_Usuario::TABLE_NAME)->where("username = ?", $username);
            return $db->fetchRow($select);
        } catch (Exception $e) {
            throw $e;
        }
    }
    
    public function changePassw($username,$new_pass) {
        $db = Zend_Db_Table::getDefaultAdapter();
        try {
            $data['passw'] = $new_pass;
            $user = array("username =  ?" => $username);
            $db->update(VirtualLabs_Academico_Usuario::TABLE_NAME, $data, $user);            
        } catch (Exception $e) {
            throw $e;
        }
    }

}

?>
